load("//tensorflow:strict.default.bzl", "py_strict_library", "py_strict_test")

# Description:
#   Python API for XLA.
load("//tensorflow/compiler/xla/tests:build_defs.bzl", "generate_backend_suites")

package(
    # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
    licenses = ["notice"],
)

generate_backend_suites()

py_strict_library(
    name = "types",
    srcs = ["types_.py"],
    srcs_version = "PY3",
    visibility = ["//visibility:public"],
    deps = [
        "//tensorflow/compiler/xla:xla_data_proto_py",
        "//tensorflow/tsl/python/lib/core:pywrap_ml_dtypes",
        "//third_party/py/numpy",
        "@ml_dtypes",
    ],
)

py_strict_library(
    name = "xla_shape",
    srcs = ["xla_shape.py"],
    srcs_version = "PY3",
    visibility = ["//visibility:public"],
    deps = [
        ":types",
        "//tensorflow/compiler/xla:xla_data_proto_py",
        "//third_party/py/numpy",
    ],
)

py_strict_library(
    name = "xla_literal",
    srcs = ["xla_literal.py"],
    srcs_version = "PY3",
    visibility = ["//visibility:public"],
    deps = [
        ":types",
        ":xla_shape",
        "//tensorflow/compiler/xla:xla_data_proto_py",
        "//third_party/py/numpy",
    ],
)

py_strict_test(
    name = "xla_shape_test",
    srcs = ["xla_shape_test.py"],
    python_version = "PY3",
    srcs_version = "PY3",
    tags = [
        "optonly",
    ],
    deps = [
        ":xla_shape",
        "//tensorflow/compiler/xla:xla_data_proto_py",
        "//third_party/py/numpy",
        "@absl_py//absl/testing:absltest",
    ],
)

py_strict_test(
    name = "xla_literal_test",
    srcs = ["xla_literal_test.py"],
    python_version = "PY3",
    srcs_version = "PY3",
    tags = [
        "optonly",
    ],
    deps = [
        ":xla_literal",
        "//tensorflow/compiler/xla:xla_data_proto_py",
        "//third_party/py/numpy",
        "@absl_py//absl/testing:absltest",
    ],
)
